/*
 * timer.h
 *
 *  Created on: Apr 16, 2015
 *      Author: mxw
 */

#ifndef TIMER_H_
#define TIMER_H_

#define ERR_TIMER_ID (0xFFFF)
typedef void (*ON_TIME_OUT_FUNC)(unsigned short tid);

void init_timer();
unsigned short get_new_timer(ON_TIME_OUT_FUNC fn);
void delete_timer(unsigned short tid);

void start_timer(unsigned short tid, unsigned long interval_in_ms);
void stop_timer(unsigned short tid);

unsigned int get_sys_ticker();

void on_timer_loop(); //for interupt
void call_timer_func(unsigned short tid);//for main queue call

void init_INT_TIMER1_for_simos();
#endif /* TIMER_H_ */
